package br.furb.jpa.dao;

import java.util.ArrayList;

import br.furb.jpa.persistence.GenericPersistence;
import br.furb.jpa.persistence.GenericPersistenceException;
import br.furb.jpa.persistence.OrderType;
import br.furb.models.Usuario;

public class UsuarioDAO extends GenericPersistence<Usuario> implements
		DAOObject<Usuario> {

	public UsuarioDAO(String puName) {
		super(puName);
	}

	@Override
	public ArrayList<Usuario> search(OrderType orderType)
			throws GenericPersistenceException {
		ArrayList<Usuario> returnList;
		Object[] parameters = {};
		if (orderType == OrderType.Asc)
			returnList = this.executeNamedQuery("Usuario.searchAsc", parameters);
		else
			returnList = this.executeNamedQuery("Usuario.searchDesc", parameters);

		return returnList;
	}

	@Override
	public Boolean isUsed(Usuario entity) throws GenericPersistenceException {

		return false;
	}

}
